<template>
  <div class="legend-box">
    <div class="legend-list">
      <div class="legend-item" v-for="item in legendList" :key="item.name">
        <img :src="item.icon" alt="" class="img-icon" />
        <span class="legend-text">{{ item.text }}</span>
      </div>
    </div>
  </div>
</template>
<script lang="ts" setup>
const legendList = [
  {
    name: "project",
    icon: new URL("@/assets/img/poi/rectification.png", import.meta.url).href,
    color: "#fff",
    text: "整治建议",
  },
  {
    name: "issue",
    icon: new URL("@/assets/img/poi/issue.png", import.meta.url).href,
    color: "#fff",
    text: "问题清单",
  },

  {
    name: "project",
    icon: new URL("@/assets/img/poi/project.png", import.meta.url).href,
    color: "#fff",
    text: "项目更新",
  },
];
</script>
<style lang="scss" scoped>
.legend-box {
  position: absolute;
  left: 560px;
  bottom: 10px;
}
.legend-list {
  width: 160px;
  padding: 16px;
  border: 1px solid #333;
  background: rgba(0, 0, 0, 0.4);

  .legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    &:last-child {
      margin-bottom: 0;
    }
  }
  .img-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
  }
}
</style>